import request from '@/utils/request';
import {
  stringify
} from 'qs';

export async function getModelTemplateList(modelId) {
  return request(
    `/api/cms/template/v1.0/getModelTemplateList?modelId=${modelId}`
  );
}

export async function getTemplateContext(templateId) {
  return request(
    `/api/cms/template/v1.0/getTemplateContext?templateId=${templateId}`
  );
}

export async function forcast(params) {
  return request(`/api/public/api/public/v1/predict/${params.serviceId}/${params.endpointId}/DEFAULT?${stringify({ accessKey: params.accessKey, modelId: params.modelId })}`, {
    method: 'POST',
    body: params.data
  });
}
